const React = require("react");

export default class UI extends React.Component{
  constructor(props){
    super(props);
  }
  render(){
    let lis = this.props.list.map(item => <li
                                    key={item.id}
                                    onClick={()=>this.props.onSelect(item.id)}>
                                  {item.name}
                                  </li>);
    return <ul>
        {lis}
    </ul>
  }
}
